﻿using CoreCms.Net.Bz.Common.Response;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using Silky.Core.DependencyInjection;

namespace CoreCms.Net.Services
{
    public class TestService : BaseServices<TestRole>, ITestService, ISingletonDependency
    {
        private readonly ICoreCmsUserRepository _userdal;
        private readonly ITestRepository _dal;

        private readonly IUnitOfWork _unitOfWork;

        public TestService(IUnitOfWork unitOfWork
            , ITestRepository dal
            , ICoreCmsUserRepository userdal)
        {
            this._dal = dal;
            base.BaseDal = dal;
            _userdal = userdal;
            _unitOfWork = unitOfWork;
        }

        public WebApiCallBack TestKuaKu()
        {
            var jm = new WebApiCallBack();

            var lsit = _dal.Query();
            var list1 = BaseDal.Query();
            var list2 = _unitOfWork.GetDbClient().GetConnection("1").Queryable<TestRole>().ToList();
            var uer = _userdal.Query();
            return jm;
        }
    }
}